package br.com.knowledge.persistence.hibernate.entities;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * FntClasse entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "fnt_classe", schema = "public")
public class FntClasse implements java.io.Serializable {

	// Fields

	private Integer id;
	private FntFonte fntFonte;
	private String nomeclasse;
	private Set<FntObjeto> fntObjetos = new HashSet<FntObjeto>(0);
	private Set<FntMetodoclasse> fntMetodoclasses = new HashSet<FntMetodoclasse>(
			0);
	private Set<FntObjeto> fntObjetos_1 = new HashSet<FntObjeto>(0);
	private Set<FntMetodoclasse> fntMetodoclasses_1 = new HashSet<FntMetodoclasse>(
			0);

	// Constructors

	/** default constructor */
	public FntClasse() {
	}

	/** minimal constructor */
	public FntClasse(FntFonte fntFonte, String nomeclasse) {
		this.fntFonte = fntFonte;
		this.nomeclasse = nomeclasse;
	}

	/** full constructor */
	public FntClasse(FntFonte fntFonte, String nomeclasse,
			Set<FntObjeto> fntObjetos, Set<FntMetodoclasse> fntMetodoclasses,
			Set<FntObjeto> fntObjetos_1, Set<FntMetodoclasse> fntMetodoclasses_1) {
		this.fntFonte = fntFonte;
		this.nomeclasse = nomeclasse;
		this.fntObjetos = fntObjetos;
		this.fntMetodoclasses = fntMetodoclasses;
		this.fntObjetos_1 = fntObjetos_1;
		this.fntMetodoclasses_1 = fntMetodoclasses_1;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fnt_fonte_id", nullable = false)
	public FntFonte getFntFonte() {
		return this.fntFonte;
	}

	public void setFntFonte(FntFonte fntFonte) {
		this.fntFonte = fntFonte;
	}

	@Column(name = "nomeclasse", nullable = false, length = 50)
	public String getNomeclasse() {
		return this.nomeclasse;
	}

	public void setNomeclasse(String nomeclasse) {
		this.nomeclasse = nomeclasse;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "fntClasses")
	public Set<FntObjeto> getFntObjetos() {
		return this.fntObjetos;
	}

	public void setFntObjetos(Set<FntObjeto> fntObjetos) {
		this.fntObjetos = fntObjetos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "fntClasse")
	public Set<FntMetodoclasse> getFntMetodoclasses() {
		return this.fntMetodoclasses;
	}

	public void setFntMetodoclasses(Set<FntMetodoclasse> fntMetodoclasses) {
		this.fntMetodoclasses = fntMetodoclasses;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinTable(name = "aft_objetoclasse", schema = "public", joinColumns = { @JoinColumn(name = "fnt_classe_id", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "fnt_objeto_id", nullable = false, updatable = false) })
	public Set<FntObjeto> getFntObjetos_1() {
		return this.fntObjetos_1;
	}

	public void setFntObjetos_1(Set<FntObjeto> fntObjetos_1) {
		this.fntObjetos_1 = fntObjetos_1;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "fntClasse")
	public Set<FntMetodoclasse> getFntMetodoclasses_1() {
		return this.fntMetodoclasses_1;
	}

	public void setFntMetodoclasses_1(Set<FntMetodoclasse> fntMetodoclasses_1) {
		this.fntMetodoclasses_1 = fntMetodoclasses_1;
	}

}